home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / graphics / copper.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  3KB  |  107 lines

  1. #ifndef GRAPHICS_COPPER_H
  2. #define GRAPHICS_COPPER_H
  3. /*
  4. **    $Filename: graphics/copper.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 37.0 $
  7. **    $Date: 91/01/07 $
  8. **
  9. **    graphics copper list intstruction definintions
  10. **
  11. **    (C) Copyright 1985,1986,1987,1988,1989 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #define COPPER_MOVE 0        /* pseude opcode for move #XXXX,dir */
  20. #define COPPER_WAIT 1        /* pseudo opcode for wait y,x */
  21. #define CPRNXTBUF   2        /* continue processing with next buffer */
  22. #define CPR_NT_LOF  0x8000  /* copper instruction only for short frames */
  23. #define CPR_NT_SHT  0x4000  /* copper instruction only for long frames */
  24. #define CPR_NT_SYS  0x2000  /* copper user instruction only */
  25.  
  26. struct CopIns
  27. {
  28.     WORD   OpCode; /* 0 = move, 1 = wait */
  29.     union
  30.     {
  31.     struct CopList *nxtlist;
  32.     struct
  33.     {
  34.    union
  35.    {
  36.    WORD   VWaitPos;       /* vertical beam wait */
  37.    WORD   DestAddr;       /* destination address of copper move */
  38.    } u1;
  39.    union
  40.    {
  41.    WORD   HWaitPos;       /* horizontal beam wait position */
  42.    WORD   DestData;       /* destination immediate data to send */
  43.    } u2;
  44.     } u4;
  45.     } u3;
  46. };
  47. /* shorthand for above */
  48. #define NXTLIST     u3.nxtlist
  49. #define VWAITPOS    u3.u4.u1.VWaitPos
  50. #define DESTADDR    u3.u4.u1.DestAddr
  51. #define HWAITPOS    u3.u4.u2.HWaitPos
  52. #define DESTDATA    u3.u4.u2.DestData
  53.  
  54.  
  55. /* structure of cprlist that points to list that hardware actually executes */
  56. struct cprlist
  57. {
  58.     struct cprlist *Next;
  59.     UWORD   *start;        /* start of copper list */
  60.     WORD   MaxCount;       /* number of long instructions */
  61. };
  62.  
  63. struct CopList
  64. {
  65.     struct  CopList *Next;  /* next block for this copper list */
  66.     struct  CopList *_CopList;    /* system use */
  67.     struct  ViewPort *_ViewPort;    /* system use */
  68.     struct  CopIns *CopIns; /* start of this block */
  69.     struct  CopIns *CopPtr; /* intermediate ptr */
  70.     UWORD   *CopLStart;     /* mrgcop fills this in for Long Frame*/
  71.     UWORD   *CopSStart;     /* mrgcop fills this in for Short Frame*/
  72.     WORD   Count;       /* intermediate counter */
  73.     WORD   MaxCount;       /* max # of copins for this block */
  74.     WORD   DyOffset;       /* offset this copper list vertical waits */
  75. #ifdef V1_3
  76.     UWORD   *Cop2Start;
  77.     UWORD   *Cop3Start;
  78.     UWORD   *Cop4Start;
  79.     UWORD   *Cop5Start;
  80. #endif
  81. };
  82.  
  83. struct UCopList
  84. {
  85.     struct UCopList *Next;
  86.     struct CopList  *FirstCopList; /* head node of this copper list */
  87.     struct CopList  *CopList;       /* node in use */
  88. };
  89.  
  90. /* private graphics data structure */
  91.  
  92. struct copinit
  93. {
  94.     UWORD vsync_hblank[2];
  95.     UWORD diwstart[4];
  96.     UWORD diagstrt[4];        /* copper list for first bitplane */
  97.     UWORD sprstrtup[(2*8*2)];
  98.     UWORD wait14[2];
  99.     UWORD norm_hblank[2];
  100.     UWORD genloc[4];
  101.     UWORD jump[(2*2)];
  102.     UWORD wait_forever[2];
  103.     UWORD   sprstop[4];
  104. };
  105.  
  106. #endif    /* GRAPHICS_COPPER_H */
  107.